package com.example.mymvp2.modle;


import com.example.mymvp2.BaseViewListener;
import com.example.mymvp2.presenter.BasePresenter;

public class ResultCallback {

    public static BasePresenter request(String token){

        // 声明一个空的BaseModel
        BasePresenter model = null;

        try {
            //利用反射机制获得对应Model对象的引用
            model = (BasePresenter)Class.forName(token).newInstance();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return model;
    }
}
